<template>
	<li :class="{[prefixCls+'-dropdown-item']:true,'mj-dropdown-item-divided':divided}" @click.stop="handleClick">
		<slot></slot>
	</li>
</template>

<script>
import { prefixCls } from '../prefix'

export default {
	name: `${prefixCls}DropdownItem`,
	props:{
		value:{
			type:String,
			default:''
		},
		divided:{
			type:Boolean,
			default:false
		}
	},
	data() {
		return {
			prefixCls: prefixCls,
		}
	},
	mounted(){
	},
	methods:{
		handleClick(){
			let _this = this;
			let name = this.$slots.default[0].text;
			this.active = !this.active;
			this.dropDownSlideUp();
			setTimeout(()=>{
				_this.parentClick(name,this.value);
			},300)
		},
	},
	inject:['parentClick','dropDownSlideUp'],
}
</script>